package com.company.myfirstjmixproject.entity.enums;

import io.jmix.core.metamodel.datatype.impl.EnumClass;

import javax.annotation.Nullable;


/**
 * 是否含有副产品ENUM Y-是，N-否
 */
public enum ByProductEnum implements EnumClass<String> {

    Y("Y"),
    N("N");

    private String id;

    ByProductEnum(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    @Nullable
    public static ByProductEnum fromId(String id) {
        for (ByProductEnum at : ByProductEnum.values()) {
            if (at.getId().equals(id)) {
                return at;
            }
        }
        return null;
    }
}